(function() {
	
	new sCanvas("canvas", function() {
		
		var circle = this.circ({
			x: Math.random() * this.width(),
			y: Math.random() * this.height(),
			radius: 35
		});
		
		circle.click(function() {
			this.animate({
				x: this.attr("x") - 30 + Math.random() * 60,
				y: this.attr("y") - 30 + Math.random() * 60
//				x: "+=" + (30 + Math.random() * 60)
			}, 300);
		});
		
		this.rect({
			x: 385,
			y: 15,
			width: 30,
			height: 30,
			fill: "red"
		}).click(function() {
			circle.click();
			//circle.trigger("click");
		});
		
	}, function() {
		alert("Při inicializaci canvasu došlo k chybě.");
	});
	
}());